<?php 
for ($i=0;$i<$totalcategories;$i++) {
	$listproducts = $products[$i]; 
?>
<div class="box">
  <?php if(count($listproducts)){ ?>
  <div class="box-heading"><a href="index.php?route=product/category&path=<?php echo $category[$i]["category_id"];?>"><?php echo $category[$i]["name"];?></a></div>
  
  <div class="box-content">
    <div class="box-product">
      <?php foreach ($listproducts as $product) { ?>
      <div>
        <div class="image">
      	<?php if ($product['thumb']) { ?>
		<?php if(!empty($product['sticker'])) {?>
		<span><img src="<?php echo $product['sticker']?>" /></span>
		<?php } ?>
        <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a>
        <?php }else{ ?>
        <img alt="<?php echo $product['name']; ?>" src="image/cache/no_image-100x100.jpg">
        <?php }?>
        </div>
        <div class="name">
        <a href="<?php echo $product['href']; ?>">
        <?php 
        $arr_name = explode("/", $product["name"]);
        echo empty($arr_name[0])?"":$arr_name[0]; ?>
        </a></div>
        <?php if ($product['price']) { ?>
        <div class="price">
          <?php if (!$product['special']) { ?>
          <?php echo $product['price']; ?>
          <?php } else { ?>
          <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
          <?php } ?>
          <br />
          <?php if($product['vat_shown']){?>
          <span class="price-vat"><?php echo $vat?></span>
          <?php }?>
        </div>
        <?php } ?>
        <?php if ($product['rating']) { ?>
        <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
        <?php } ?>
        <div class="cart"><a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a></div>
      </div>
      <?php } ?>
    </div>
    <div align="right"><a href="index.php?route=product/category&path=<?php echo $category[$i]["category_id"];?>"><?php echo $view_all?></a></div>
  </div>
  <?php }?>
</div>
<?php } ?>
